package com.hongawen.designmode.创建型.单例模式.懒汉式;

/**
 * @author hongawen
 * 通过静态内部类的方式，在内部类中创建单例对象，在第一次调用getInstance()方法时，才创建单例对象，由JVM的双亲委派确保线程的安全
 */
public class SingletonIoDH {

    private SingletonIoDH(){

    }

    public static class InnerSingletonIoDH {
        private final static SingletonIoDH singletonIoDH = new SingletonIoDH();
    }

    public static SingletonIoDH getInstance() {
        return InnerSingletonIoDH.singletonIoDH;
    }

}
